//
//  DaiLiOneViewController.m
//  商城
//
//  Created by runone02 on 2018/9/28.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "DaiLiOneViewController.h"
#import "DaiLiTwoViewController.h"
@interface DaiLiOneViewController ()<DaiLiTwoDelegate>
/** */
@property (nonatomic,strong) UIButton *btn;
@end

@implementation DaiLiOneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"控制器1";
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.btn = [UIButton buttonWithType: UIButtonTypeCustom];
    [self.btn setTitle:@"设置" forState:UIControlStateNormal];
    [self.btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.btn addTarget:self action:@selector(BtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.btn];
    [self.btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.centerX.mas_equalTo(self.view);
        make.width.height.mas_equalTo(50);
    }];
}


- (void)BtnClick{
    DaiLiTwoViewController *vc = [[DaiLiTwoViewController alloc]init];
    vc.DaiLiTwoDelegate = self;
    [self.navigationController pushViewController:vc animated:YES];
}


- (void)doset:(NSString *)str{
    [self.btn setTitle:str forState:UIControlStateNormal];
}

@end
